package com.livepan.server.response;

public class CommonReturnType {

    private int status;

    private String message;
    //若status为success ，则返回前端需要的数据，fail则返回通用的错误码格式
    private Object data;

    public static CommonReturnType create(Object result) {
        return create(result, 200, "success");
    }

    public static CommonReturnType create(Object result, int status, String message) {
        CommonReturnType type = new CommonReturnType();
        type.setStatus(status);
        type.setData(result);
        type.setMessage(message);
        return type;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
